<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <script src="JS/jquery-1.8.3.min.js"></script>
    <link href="CSS/body.css" rel="stylesheet" type="text/css"/>
    <title>相册</title>
</head>
<body>
    <script>
        (function(){
            for(var index=1;index<31;index++){
                var o = $('<div><img src="./photo/thumb/'+index+'.jpg"/></div>');
                $("body").append(o);//显示图片列表
                if(o.children().width()>o.children().height()){//根据图片的相关宽高指定背景图片
                    o.attr("class","ls");
                }else{
                    o.attr("class","pt");
                }
            }
        })();
    </script>
</body>

</html>